package com.cskaoyan._13thread._01introduct;

/**
 * @author Macro_Ray
 * @since 2024/3/21 17:11
 */
// 多线程
// 程序不停的输出你好直到输入end
public class Demo1 {
    // 单线程，程序的执行是一条线，先执行完一条再执行下一条
    public static void main(String[] args) throws InterruptedException {


        sayHello();

        waitUserInputEnd();


    }

    private static void sayHello() {
        /*while (flag) {
            System.out.println("你好");
            TimeUnit.SECONDS.sleep(3);
        }*/
    }

    private static void waitUserInputEnd() throws InterruptedException {
        /*Scanner sc = new Scanner(System.in);
        String string = sc.nextLine();

        if ("end".equals(string)) {
            flag = false;*/
        }

    }


